import java.awt.Color;



import becker.robots.*;
public class Light extends Thing{
	int street, avenue;
	public Light(City aCity, int aStreet, int anAvenue) {
		super(aCity, aStreet, anAvenue);
		street = aStreet;
		avenue = anAvenue;

	}
	public void state(boolean a) {
		if (a){
			this.setColor(Color.YELLOW);
		} else {
			this.setColor(Color.GRAY);
		}
	}
	public int getStreet(){
		return street;
	}
	public int getAvenue() {
		return avenue;
	}

	public void flash(int i) throws InterruptedException{
		for (int x = 0; x < i; x++){
			this.state(false);
			Thread.currentThread();
			Thread.sleep(100);
			this.state(true);	
			Thread.sleep(100);
		}
	}
}



